home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / program / gncdev24.lha / E / DemoGenCodeE / GUI.e < prev    next >
Text File  |  1995-09-12  |  7KB  |  223 lines

  1. OPT MODULE
  2. OPT PREPROCESS
  3.  
  4.  
  5. ->/////////////////////////////////////////////////////////////////////////////
  6. ->//////////////////////////////////////////////////////////// MODULE ... /////
  7. ->/////////////////////////////////////////////////////////////////////////////
  8. MODULE 'muimaster' , 'libraries/mui'
  9. MODULE 'tools/boopsi' , 'libraries/gadtools'
  10. MODULE 'utility/tagitem' , 'utility/hooks'
  11.  
  12.  
  13. ->/////////////////////////////////////////////////////////////////////////////
  14. ->//////////////////////////////////////////////////////////// OBJECT ... /////
  15. ->/////////////////////////////////////////////////////////////////////////////
  16. EXPORT OBJECT app_arexx
  17.     commands :    PTR TO mui_command
  18.     error    :    hook
  19. ENDOBJECT
  20.  
  21. EXPORT OBJECT app_display
  22.     button_pressed          :    hook
  23. ENDOBJECT
  24.  
  25. EXPORT OBJECT app_obj
  26.     app                     :    PTR TO LONG
  27.     wi_the_window           :    PTR TO LONG
  28.     bt_put_constant_string  :    PTR TO LONG
  29.     bt_put_variable         :    PTR TO LONG
  30.     bt_return_id            :    PTR TO LONG
  31.     bt_call_hook            :    PTR TO LONG
  32.     tx_result               :    PTR TO LONG
  33.     bt_quit                 :    PTR TO LONG
  34.     stR_TX_result           :    PTR TO CHAR
  35. ENDOBJECT
  36.  
  37.  
  38. ->/////////////////////////////////////////////////////////////////////////////
  39. ->/////////////////////////////////////////////////////// CONST ... = ... /////
  40. ->/////////////////////////////////////////////////////////////////////////////
  41. EXPORT ENUM
  42.     ID_BUTTON_PRESSED = 1
  43.  
  44.  
  45. ->/////////////////////////////////////////////////////////////////////////////
  46. ->///////////////////////////////////////////////////////// DEF ... = ... /////
  47. ->/////////////////////////////////////////////////////////////////////////////
  48. EXPORT DEF string_var
  49.  
  50.  
  51. ->/////////////////////////////////////////////////////////////////////////////
  52. ->/////////////////////////////////////////////////////////// PROC create /////
  53. ->/////////////////////////////////////////////////////////////////////////////
  54. PROC create( display : PTR TO app_display ,
  55.              icon  = NIL ,
  56.              arexx = NIL : PTR TO app_arexx ,
  57.              menu  = NIL ) OF app_obj
  58.  
  59.     DEF grOUP_ROOT_0C , gr_grp_0 , gr_grp_1 , la_result , gr_grp_2
  60.  
  61.     self.stR_TX_result           := 'Zzzzzzzzzzzzz'
  62.  
  63.     self.bt_put_constant_string := TextObject ,
  64.         ButtonFrame ,
  65.         MUIA_Background , MUII_ButtonBack ,
  66.         MUIA_ControlChar , "c" ,
  67.         MUIA_Text_Contents , 'Put Constant String' ,
  68.         MUIA_Text_PreParse , '\ec' ,
  69.         MUIA_Text_HiChar , "c" ,
  70.         MUIA_HelpNode , 'BT_put_constant_string' ,
  71.         MUIA_InputMode , MUIV_InputMode_RelVerify ,
  72.     End
  73.  
  74.     self.bt_put_variable := TextObject ,
  75.         ButtonFrame ,
  76.         MUIA_Background , MUII_ButtonBack ,
  77.         MUIA_ControlChar , "v" ,
  78.         MUIA_Text_Contents , 'Put Variable' ,
  79.         MUIA_Text_PreParse , '\ec' ,
  80.         MUIA_Text_HiChar , "v" ,
  81.         MUIA_HelpNode , 'BT_put_variable' ,
  82.         MUIA_InputMode , MUIV_InputMode_RelVerify ,
  83.     End
  84.  
  85.     self.bt_return_id := SimpleButton( '_Return ID' )
  86.  
  87.     self.bt_call_hook := TextObject ,
  88.         ButtonFrame ,
  89.         MUIA_Background , MUII_ButtonBack ,
  90.         MUIA_ControlChar , "h" ,
  91.         MUIA_Text_Contents , 'Call Hook' ,
  92.         MUIA_Text_PreParse , '\ec' ,
  93.         MUIA_Text_HiChar , "h" ,
  94.         MUIA_HelpNode , 'BT_call_hook' ,
  95.         MUIA_InputMode , MUIV_InputMode_RelVerify ,
  96.     End
  97.  
  98.     la_result := Label( 'Result' )
  99.  
  100.     self.tx_result := TextObject ,
  101.         MUIA_HelpNode , 'TX_result' ,
  102.         MUIA_Background , MUII_TextBack ,
  103.         MUIA_Frame , MUIV_Frame_Text ,
  104.         MUIA_Text_Contents , self.stR_TX_result ,
  105.         MUIA_Text_PreParse , '\el' ,
  106.         MUIA_Text_SetMin , MUI_TRUE ,
  107.     End
  108.  
  109.     gr_grp_1 := GroupObject ,
  110.         MUIA_Group_Horiz , MUI_TRUE ,
  111.         Child , la_result ,
  112.         Child , self.tx_result ,
  113.     End
  114.  
  115.     gr_grp_0 := GroupObject ,
  116.         MUIA_Frame , MUIV_Frame_Group ,
  117.         MUIA_FrameTitle , 'Click !' ,
  118.         Child , self.bt_put_constant_string ,
  119.         Child , self.bt_put_variable ,
  120.         Child , self.bt_return_id ,
  121.         Child , self.bt_call_hook ,
  122.         Child , gr_grp_1 ,
  123.     End
  124.  
  125.     self.bt_quit := TextObject ,
  126.         ButtonFrame ,
  127.         MUIA_Background , MUII_ButtonBack ,
  128.         MUIA_ControlChar , "q" ,
  129.         MUIA_Text_Contents , 'Quit' ,
  130.         MUIA_Text_PreParse , '\ec' ,
  131.         MUIA_Text_HiChar , "q" ,
  132.         MUIA_HelpNode , 'BT_quit' ,
  133.         MUIA_InputMode , MUIV_InputMode_RelVerify ,
  134.     End
  135.  
  136.     gr_grp_2 := GroupObject ,
  137.         Child , self.bt_quit ,
  138.     End
  139.  
  140.     grOUP_ROOT_0C := GroupObject ,
  141.         Child , gr_grp_0 ,
  142.         Child , gr_grp_2 ,
  143.     End
  144.  
  145.     self.wi_the_window := WindowObject ,
  146.         MUIA_Window_Title , 'The window !' ,
  147.         MUIA_HelpNode , 'WI_the_window' ,
  148.         MUIA_Window_ID , "0WIN" ,
  149.         WindowContents , grOUP_ROOT_0C ,
  150.     End
  151.  
  152.     self.app := ApplicationObject ,
  153.         ( IF icon THEN MUIA_Application_DiskObject ELSE TAG_IGNORE ) , icon ,
  154.         ( IF arexx THEN MUIA_Application_Commands ELSE TAG_IGNORE ) , ( IF arexx THEN arexx.commands ELSE NIL ) ,
  155.         ( IF arexx THEN MUIA_Application_RexxHook ELSE TAG_IGNORE ) , ( IF arexx THEN arexx.error ELSE NIL ) ,
  156.         ( IF menu THEN MUIA_Application_Menu ELSE TAG_IGNORE ) , menu ,
  157.         MUIA_Application_Author , 'Lionel Vintenat' ,
  158.         MUIA_Application_Base , 'DEMOGENCODEE' ,
  159.         MUIA_Application_Title , 'DemoGenCodeE' ,
  160.         MUIA_Application_Version , '$VER: DemoGenCodeE 1.0 (01.09.94)' ,
  161.         MUIA_Application_Copyright , 'Public Domain !' ,
  162.         MUIA_Application_Description , 'Application example for GenCodeE' ,
  163.         SubWindow , self.wi_the_window ,
  164.     End
  165.  
  166. ENDPROC self.app
  167.  
  168.  
  169. ->/////////////////////////////////////////////////////////////////////////////
  170. ->////////////////////////////////////////////////////////// PROC dispose /////
  171. ->/////////////////////////////////////////////////////////////////////////////
  172. PROC dispose() OF app_obj IS ( IF self.app THEN Mui_DisposeObject( self.app ) ELSE NIL )
  173.  
  174.  
  175. ->/////////////////////////////////////////////////////////////////////////////
  176. ->/////////////////////////////////////////////// PROC init_notifications /////
  177. ->/////////////////////////////////////////////////////////////////////////////
  178. PROC init_notifications( display : PTR TO app_display ) OF app_obj
  179.  
  180.     domethod( self.bt_put_constant_string , [
  181.         MUIM_Notify , MUIA_Pressed , FALSE ,
  182.         self.tx_result ,
  183.         3 ,
  184.         MUIM_Set , MUIA_Text_Contents , 'Constant string put !' ] )
  185.  
  186.     domethod( self.bt_put_variable , [
  187.         MUIM_Notify , MUIA_Pressed , FALSE ,
  188.         self.tx_result ,
  189.         3 ,
  190.         MUIM_Set , MUIA_Text_Contents , string_var ] )
  191.  
  192.     domethod( self.bt_return_id , [
  193.         MUIM_Notify , MUIA_Pressed , FALSE ,
  194.         self.app ,
  195.         2 ,
  196.         MUIM_Application_ReturnID , ID_BUTTON_PRESSED ] )
  197.  
  198.     domethod( self.bt_call_hook , [
  199.         MUIM_Notify , MUIA_Pressed , FALSE ,
  200.         self.app ,
  201.         2 ,
  202.         MUIM_CallHook , display.button_pressed ] )
  203.  
  204.     domethod( self.bt_quit , [
  205.         MUIM_Notify , MUIA_Pressed , FALSE ,
  206.         self.app ,
  207.         2 ,
  208.         MUIM_Application_ReturnID , MUIV_Application_ReturnID_Quit ] )
  209.  
  210.     domethod( self.wi_the_window , [
  211.         MUIM_Window_SetCycleChain , self.bt_put_constant_string ,
  212.         self.bt_put_variable ,
  213.         self.bt_return_id ,
  214.         self.bt_call_hook ,
  215.         self.bt_quit ,
  216.         0 ] )
  217.  
  218.     set( self.wi_the_window ,MUIA_Window_Open , MUI_TRUE )
  219.  
  220. ENDPROC
  221.  
  222.  
  223.